package com.gable.report.common.util;

/**
 * @Author: 杨青桦
 * @Description:  天气省份插件工具类
 * @Date: 2018/1/22 18:22
 */
public enum  WeatherProvinceUtil {

    beijing("北京市","beijing"),
    tianjin("天津市","tianjin"),
    hebei("河北省","hebei"),
    shanxi("山西省","shanxi"),
    neimenggu("内蒙古自治区","neimenggu"),
    liaoning("辽宁省","liaoning"),
    jilin("吉林省","jilin"),
    heilongjiang("黑龙江省","heilongjiang"),
    shanghai("上海市","shanghai"),
    jiangsu("江苏省","jiangsu"),
    zhejiang("浙江省","zhejiang"),
    anhui("安徽省","anhui"),
    fujian("福建省","fujian"),
    jiangxi("江西省","jiangxi"),
    shandong("山东省","shandong"),
    henan("河南省","henan"),
    hubei("湖北省","hubei"),
    hunan("湖南省","hunan"),
    guangdong("广东省","guangdong"),
    guangxi("广西壮族自治区","guangxi"),
    hainan("海南省","hainan"),
    chongqing("重庆市","chongqing"),
    sichuan("四川省","sichuan"),
    guizhou("贵州省","guizhou"),
    yunnan("云南省","yunnan"),
    xizang("西藏自治区","xizang"),
    sanxi("陕西省","sanxi"),
    gansu("甘肃省","gansu"),
    qinghai("青海省","qinghai"),
    ningxia("宁夏回族自治区","ningxia"),
    xinjiang("新疆维吾尔自治区","xinjiang"),
    taiwan("台湾省","taiwan"),
    xianggang("香港特别行政区","xianggang"),
    aomen("澳门特别行政区","aomen");

    private String key;
    private String value;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    private WeatherProvinceUtil(String key, String value){
        this.key = key;
        this.value = value;
    }

    public static String getValue(String key){
        WeatherProvinceUtil [] values = WeatherProvinceUtil.values();
        for(WeatherProvinceUtil wpu : values){
            if(wpu.getKey().equals(key)){
                return wpu.getValue();
            }
        }
        return null;
    }
}
